package com.last.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVO<T> {
    private Integer code;
    private String message;
    private T data;

    public ResultVO(ResponseEnum responseEnum){
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMsg();
    }

    public ResultVO(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResultVO(ResponseEnum responseEnum, T data){
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMsg();
        this.data = data;
    }

}
